// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.

.forum-post {
  @_top: forum-post;
  @_padding-content: 20px;

  border-bottom: 1px solid @osu-colour-b1;
  padding: 0;

  display: flex;

  &.js-forum-post--hidden {
    opacity: 0.5;
  }

  &.js-forum-post--highlighted {
    background-color: @osu-colour-b3;
  }

  &__actions {
    display: none;
    position: absolute;
    transition: opacity 120ms ease-in-out;
    will-change: opacity;

    right: @gutter-v2;
    top: (@_padding-content - 10px);

    @media @desktop {
      right: @gutter-v2-desktop;
      display: flex;
      gap: 5px;
      opacity: 0;
    }

    .@{_top}:hover & {
      @media @desktop {
        opacity: 1;
      }
    }
  }

  &__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;

    // to prevent child from overflowing
    // reference: https://bugzilla.mozilla.org/show_bug.cgi?id=1108514#c2
    min-width: 0;
  }

  &__content {
    font-size: @font-size--small-2;
    flex: none;
    padding: 0 @gutter-v2 @_padding-content @_padding-content;

    @media @desktop {
      font-size: @font-size--normal;
      padding-right: @gutter-v2-desktop;
    }

    &--blocked {
      padding-top: @_padding-content;
      font-size: @font-size--title-small;
    }

    &--footer {
      color: @osu-colour-c2;
    }

    &--header {
      padding-top: 10px;
      display: flex;
      align-items: baseline;
      font-size: @font-size--small;

      @media @desktop {
        padding-top: @_padding-content;
        font-size: @font-size--normal;
      }
    }

    &--main {
      flex: 1 0 auto;
    }

    &--signature {
      border-top: 1px solid @osu-colour-b1;

      .content-font();
      padding: 10px 0 0;
      margin: 0 @gutter-v2 @_padding-content @_padding-content;
      color: @osu-colour-c2;
      display: none;
      max-height: (@forum-signature-height + 20px);
      overflow: hidden;

      @media @desktop {
        display: block;
        margin-right: @gutter-v2-desktop;
      }
    }
  }

  &__header-content {
    display: flex;
    flex-direction: column;
    margin: -5px -2px;

    @media @desktop {
      flex-direction: row;
    }
  }

  &__header-content-item {
    margin: 5px 2px;
  }

  &__menu {
    margin-left: auto;
    position: relative;

    @media @desktop {
      display: none;
    }
  }

  &__menu-button {
    .reset-input();
    padding: 5px;
  }

  &__user {
    font-weight: 600;
    font-size: @font-size--title-small;

    @media @desktop {
      display: none;
    }
  }
}
